-- GENERATED SPELL FOR [Tidewalker Hydromancer] --


function spell0_21228(pUnit, Event) --@Frost Nova,Self--
pUnit:FullCastSpellOnTarget(39063,pUnit)
pUnit:RegisterEvent('Sorts_21228', 8321, 1)
end

function spell1_21228(pUnit, Event) --@Frost Shock,n/a--
pUnit:FullCastSpellOnTarget(39062,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_21228', 8348, 1)
end

function spell2_21228(pUnit, Event) --@Frostbolt,n/a--
pUnit:FullCastSpellOnTarget(39064,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_21228', 6000, 1)
end

function Sorts_21228(pUnit, Event)
local choix_sorts_21228 = math.random(0, 2)
if choix_sorts_21228 == 0 then
pUnit:RegisterEvent('spell0_21228', 1, 1)
end
if choix_sorts_21228 == 1 then
pUnit:RegisterEvent('spell1_21228', 1, 1)
end
if choix_sorts_21228 == 2 then
pUnit:RegisterEvent('spell2_21228', 1, 1)
end
end

function mob21228_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_21228', math.random(1500, 3000), 1)
end

function mob21228_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob21228_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob21228_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(21228, 1, 'mob21228_Action')
RegisterUnitEvent(21228, 2, 'mob21228_Leave')
RegisterUnitEvent(21228, 3, 'mob21228_Kill')
RegisterUnitEvent(21228, 4, 'mob21228_Die')
